package com.joysuch.wwyt.mh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.joysuch.wwyt.mh.entity.MhAlarmRecord;
import com.joysuch.wwyt.monitoringcenter.bean.AlarmMessageCountBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Leong
 * @date 2022/9/19 16:12
 */
@Repository
public interface MhAlarmRecordMapper extends BaseMapper<MhAlarmRecord> {
    MhAlarmRecord findValidRecord(@Param("monitoringPointId") Long monitoringPointId,@Param("state") Integer state);

    List<MhAlarmRecord> findValidNoCode(@Param("exceedTimes")Integer exceedTimes);

    List<MhAlarmRecord> findValidRecords(@Param("pointIds")List<Long> pointIds, @Param("state")Integer state);

    List<AlarmMessageCountBean> countByMhPointIdsAndStateNotEq(@Param("pointIds")List<Long> pointIds, @Param("state")int state);
}
